package shizhan.proxy;

import net.sf.cglib.proxy.Enhancer;

import javax.swing.*;

public class CalculatorInperceptorFactory {
    public  static  <T> T create(Class<T> target,String methodName){
        CalculatorInperceptor inperceptor = new CalculatorInperceptor(target,methodName);
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target);

        enhancer.setCallback(inperceptor);

        return (T)enhancer.create();

    }
}
